
$(function() {
    validateRule();
});

$.validator.setDefaults({
    submitHandler: function() {
        $.modal.loading($("#btnSubmit").data("loading"));
        var form = document.getElementById('signupForm');
        form.submit();
    }
});
function validateRule() {
    var icon = "<i class='fa fa-times-circle'></i> ";
    $("#signupForm").validate({
        rules: {
            username: {
                required: true
            },
            password: {
                required: true
            }
        },
        messages: {
            username: {
                required: icon + "请输入您的用户名",
            },
            password: {
                required: icon + "请输入您的密码",
            }
        }
    })
}